
// ------------------------------------------------------------------------------------------------
// File   : DX9PostFog.h
// Date   : 2011-01-26
// Author : Weng xiao yi
// Descr. : 
//
// ------------------------------------------------------------------------------------------------


#ifndef GUARD_DX9AE_FOG_H
#define GUARD_DX9AE_FOG_H


typedef enum
{
	eDX9_AE_PostFog_Param_FOGTYPE = 0,
	eDX9_AE_PostFog_Param_NEARLOWDISTANCE,
	eDX9_AE_PostFog_Param_FARHIGHDISTANCE,
	eDX9_AE_PostFog_Param_NEARLOWDENSITY,
	eDX9_AE_PostFog_Param_FARHIGHDENSITY,
	eDX9_AE_PostFog_Param_Num,

} DX9_AE_PostFog_Param;

class DX9AE_PostFog : public DX9AfterEffect
{
public:
	DX9AE_PostFog();
	virtual ~DX9AE_PostFog();

	virtual void ReInit();
	virtual void OnDeviceLost();
	virtual void OnDeviceReset();
	virtual void Shutdown();

	virtual void Apply();

	inline virtual void  SetParam(DX9_AE_Context _eContext, ULONG _ulParam, float _fValue);
	inline virtual float GetParam(DX9_AE_Context _eContext, ULONG _ulParam);

	void		SetAllResourceNull();

private:
	FLOAT	m_afFactor[eDX9_AE_PostFog_Param_Num]; 


};

inline void DX9AE_PostFog::SetParam(DX9_AE_Context _eContext, ULONG _ulParam, float _fValue)
{
	switch(_eContext)
	{
	case eDX9_AE_Context_FloatParam:
		m_afFactor[_ulParam] = _fValue;
		break;
	}
}


inline float DX9AE_PostFog::GetParam(DX9_AE_Context _eContext, ULONG _ulParam)
{
	switch(_eContext)
	{
	case eDX9_AE_Context_FloatParam:
		return m_afFactor[_ulParam];
	}

	return 0.0f;
}

#endif